/**
 * @author: Miss.杨
 * @date: 2025年1月11日 21:44:05
 * @description: 
 */
package com.sheepone.monitor.enums;

/**
 * @author: Miss.杨
 * @date: 2025年1月11日 21:44:05
 * @description:
 */
public enum SheeponePackageTypeEnum {
    HEART_BEAT_CHECK(0, "心跳检测"),
    HEART_BEAT_REPORT(1, "心跳上报"),
    AUDIT_LOG_REQUEST(2, "审计日志请求"),
    AUDIT_LOG_RESPONSE(3, "审计日志响应"),
    ;

    private byte type;
    private String description;

    public String getDescription() {
        return description;
    }

    public byte getType() {
        return type;
    }

    private SheeponePackageTypeEnum(int type, String description) {
        this.type = (byte) type;
        this.description = description;
    }

    public static SheeponePackageTypeEnum convert(byte type) {
        for (SheeponePackageTypeEnum value : SheeponePackageTypeEnum.values()) {
            if (value.getType() == type) {
                return value;
            }
        }
        return null;
    }

    public static boolean check(byte type) {
        for (SheeponePackageTypeEnum value : SheeponePackageTypeEnum.values()) {
            if (value.getType() == type) {
                return true;
            }
        }
        return false;
    }
}
